import { ShellUtil } from "./ShellUtil";
import { Main } from "../Main";

export class ProtocUtil {
    static exec() {
        ShellUtil.exec(`
cd ${Main.projPath}proto/ || exit 1
${Main.projPath}easyscript/lib/protoc-3.11.4-osx-x86_64/bin/protoc ./easy.proto --java_out=${Main.projPath}easyjava/src/main/java/ || exit 1
${Main.projPath}easyscript/lib/protoc-3.11.4-osx-x86_64/bin/protoc ./easy.proto --descriptor_set_out=${Main.projPath}easyunity/Assets/Resources/proto/easy.pb || exit 1
        `, (log)=>{
            console.log(log);
            console.log("生成了");
        })
        console.log("生成");
    }
}